<%--
  Created by IntelliJ IDEA.
  User: 何祥
  Date: 2022/4/18
  Time: 17:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>

<head>
    <title>Moods页面</title>
</head>

<body>

    <div id="moodList">
        <b>【说说列表】:</b><br>
        <c:forEach items="${moods}" var="mood">
            ------------------------------------------------<br>
            <b>用户昵称:</b><span id="account">${mood.userAccount}</span><br>

            <b>发表内容:</b><span id="content">${mood.content}</span><br>

            <b>发表时间:</b><span id="publish_time">${mood.publishTime}</span><br>

            <b>点赞数:</b><span id="praise_num">${mood.praiseNum}</span><br>

            <div style="margin-left: 350px">

                <%--传统的mysql读取--%>
                <%--<a id="praise" href="/mood/${mood.id}/praise?userId=${mood.userId}">
                    <c:if test="${isPraise eq true}">
                        <span style="color: brown">赞</span>
                    </c:if>
                    <c:if test="${isPraise ne true}">
                        赞
                    </c:if>
                </a>--%>

                <%--redis--%>
                <%--<a id="praise" href="/mood/${mood.id}/praiseByRedis?userId=${mood.userId}">
                    <c:if test="${isPraise eq true}">
                        <span style="color: brown">赞</span>
                    </c:if>
                    <c:if test="${isPraise ne true}">
                        赞
                    </c:if>
                </a>--%>

                <a id="praise" href="/mood/${mood.id}/praiseByMQ?userId=${mood.userId}">
                    <c:if test="${isPraise eq true}">
                        <span style="color: brown">赞</span>
                    </c:if>
                    <c:if test="${isPraise ne true}">
                        赞
                    </c:if>
                </a>

            </div>

        </c:forEach>
    </div>
</body>

<script>

</script>

</html>
